// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** addResource POST /api/resource/add */
export async function addResourceUsingPost(
  body: API.ResourceAddRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseLong_>('/api/resource/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** deleteResource POST /api/resource/delete */
export async function deleteResourceUsingPost(
  body: API.DeleteRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/resource/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** getResourceById GET /api/resource/get */
export async function getResourceByIdUsingGet(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getResourceByIdUsingGETParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseResource_>('/api/resource/get', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** listResource POST /api/resource/list */
export async function listResourceUsingPost(
  body: API.ResourceQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseListResource_>('/api/resource/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** listResourceByPage POST /api/resource/list/page */
export async function listResourceByPageUsingPost(
  body: API.ResourceQueryRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageResource_>('/api/resource/list/page', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** updateResource POST /api/resource/update */
export async function updateResourceUsingPost(
  body: API.ResourceUpdateRequest,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/resource/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** updateDownloadCount POST /api/resource/update/downloadCount */
export async function updateDownloadCountUsingPost(
  body: API.DownloadCountUpdateDto,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseBoolean_>('/api/resource/update/downloadCount', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
